The Accordion Pane Component > FAccordionPane.addItem() |
FAccordionPane.addItem()
Availability
Flash Player 6.
Usage
myAccordion_acp.addItem(label, linkage)
Parameters
label A string specifying the label of the new section.
linkage String. The linkage id of the symbol that will be displayed
within the section.
Returns
Nothing.
Description
Adds a new section to the end of the Accordion Pane, containing the symbol from the linkage id passed in. The content's origin point will not be modified and the content will be attached with the upper left of the content area being the upper left of the content.
Example
The accordion_example2.fla example file contains an example of using this method.
The following code adds 4 sections, attaching 4 symbols from the library into each section. It then gets a reference to the the third item and traces its label.
myAccordionPane_acp.addItem("Section 1","section1");
myAccordionPane_acp.addItem("Section 2","section2");
myAccordionPane_acp.addItem("Section 3","section3");
myAccordionPane_acp.addItem("Section 4","section4");
myAccordionPane_acp.setSelectedIndex(2);
var item = myAccordionPane_acp.getValue();
trace(item.label) // traces "Section 3"
See also
FAccordionPane.replaceItemAt()